From 1e86302d8c2ea279fee66ee7c2368258426ef876 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Mon, 7 Jan 2013 13:28:29 +0100 Subject: [PATCH] x86: compat_show_guest_stack() should not truncate MFN Re-using "addr" here was a mistake, as it is a 32-bit quantity. Signed-off-by: Jan Beulich Acked-by: Ian Campbell Acked-by: Keir Fraser --- xen/arch/x86/x86_64/compat/traps.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/x86_64/compat/traps.c b/xen/arch/x86/x86_64/compat/traps.c index 39c5656353..7add636a10 100644 --- a/xen/arch/x86/x86_64/compat/traps.c +++ b/xen/arch/x86/x86_64/compat/traps.c @@ -20,11 +20,12 @@ void compat_show_guest_stack(struct vcpu *v, struct cpu_user_regs *regs, if ( v != current ) { struct vcpu *vcpu; + unsigned long mfn; ASSERT(guest_kernel_mode(v, regs)); - addr = read_cr3() >> PAGE_SHIFT; + mfn = read_cr3() >> PAGE_SHIFT; for_each_vcpu( v->domain, vcpu ) - if ( pagetable_get_pfn(vcpu->arch.guest_table) == addr ) + if ( pagetable_get_pfn(vcpu->arch.guest_table) == mfn ) break; if ( !vcpu ) { -- 2.30.2